/**
 * @Package: 	com.group.pojo 
 * @author: 	Liu  
 * @date: 		Jan 2, 2019 7:11:50 PM 
 */
package com.group.pojo;

import java.util.ArrayList;
import java.util.List;

import com.group.DAO.GClassDAO;



/**
 * @ClassName:	 GStudentPage.java
 * @Description: 该类的功能描述
 * @author:		 Liu
 * @date: 		 Jan 2, 2019 7:11:50 PM 
 */
public class GStudentPage {
	private int pageSize = 10;
	private int pageNo = 1;
	private int totalPages;
	private List<GStudent> pageData = new ArrayList<GStudent>();
	private boolean hasNextPage;
	private boolean hasPreviousPage;
	public int getTotalPages() {
		return totalPages;
	}
	
	public List<GStudent> getPageData(String classID){
		GClassDAO dao = new GClassDAO();
		List<GStudent> list = dao.getGStudentListByID(classID, pageNo, pageSize);
		return list;
	}
	
	public boolean isHasNextPage() {
		return (this.getPageNo() < this.getTotalPages());
	}
	
	public boolean isHasPreviousPage() {
		return (this.getPageNo() > 1);
	}
	
	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}

	public void setPageData(List<GStudent> pageData) {
		this.pageData = pageData;
	}

}
